<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title> 供应商列表 </title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<link rel="stylesheet" href="admin/css/common.css" type="text/css" />
	<link rel="stylesheet" href="admin/css/provider.css" type="text/css" />
	<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
	<script type="text/javascript">
		
	</script>
  </head>
  
  <body>
  	<div id="provider_zone">
  	  <form action="provider/listProviderAdmin.action" method="post">
	  <table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style" style="color: #73938E;	font-size: 9pt;">
	    <thead>
		    <tr>
		    	<td colspan="11" style="background-color: #bbbbbb;">
		    		<input type="text" name="providerName" class="long-input" id="providerName" value="${providerName }"/>
		    		<input type="submit" value="查询"  onclick="$('#pageNo').val('1');" style="height:30px; *height:35px;*line-height:30px; padding:2px 0px 3px 5px;  width:150px; color:#73938E;" />
		    	</td>
		    </tr>
		    <tr>
		    	<td colspan="11" class="left_title_2" style="padding-right: 20px; text-align: left;" align="left">
		    		
		    		<span class="tip">
		    			当前第${page.currentPage}页，总共有${page.totalRows }条记录，总共${page.totalPages } 页。
		    			跳至第<input type="text" name="pageNo" id="pageNo" value="${pageNo }" size="2" maxlength="3" style="text-align: center;"
		    			 onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
		    			 onblur=" if(this.value > ${page.totalPages }) {this.value = ${page.totalPages };}">页
		    			<input type="submit" value=" GO! " />
		    		</span>
		    		&nbsp;&nbsp;&nbsp;&nbsp;
		    		<c:if test="${page.currentPage != 1}">
		    			<a href="provider/listProviderAdmin.action?pageNo=${pageNo -1}&hrefFlag=true&providerName=${providerName}">上一页</a>
		    		&nbsp;&nbsp;
		    		</c:if>
					<c:if test="${page.currentPage != page.totalPages}">
		    			<a href="provider/listProviderAdmin.action?pageNo=${pageNo +1}&hrefFlag=true&providerName=${providerName}">下一页</a>
		    		</c:if>
				</td>
		    </tr>
	    </thead>
	    <tr class="head">
	     	<th width="18%">供应商名字</th>
	     	<th width="3%">搜</th>
	     	<th width="5%" >省</th>
	     	<th width="5%" >市</th>
	     	<th width="16%" >地址</th>
	     	<th width="10%" >传真</th>
	     	<th width="10%" >网址</th>
	     	<th width="15%" >简介</th>
	     	<th width="8%" >完整度</th>
	     	<th width="10%" >操作</th>
	    </tr>
	    <c:forEach items="${page.list}" var="item" varStatus="loop" > 
		    <tr>
		    	<td><a target="_blank" href="provider/getProvider.action?providerId=${item.id }" style="font-size: 10pt;"> ${item.name }</a></td>
		    	<td align="center">${item.shortable }</td>
		    	<td align="center">${item.province }</td>
		    	<td align="center">${item.city }</td>
		    	<td>${item.address }</td>
		    	<td>${faxList[loop.count-1] }</td>
		    	<td>${websiteList[loop.count-1] }</td>
		    	<td>
		    		${item.shortDescription }
		    	</td>
		    	<td>${completeList[loop.count-1] }%</td>
		    	<td align="center">
		    		<a href="provider/toEditProvider.action?providerId=${item.id }&type=all">编辑</a>
		    		<c:if test="${sessionScope.admin.username == 'admin'}">
		   	 			&nbsp;|&nbsp;
		    			<a href="provider/deleteProvider.action?providerId=${item.id }" onclick="return confirm('确定删除此供应商?');" >移除</a>
		    		</c:if> 
		    	</td>
		    </tr>
		</c:forEach>
		<tfoot>
		    <tr>
		    	<td colspan="11" class="left_title_2" style="padding-right: 20px;">
		    		<span class="tip">
		    			当前第${page.currentPage}页，总共有${page.totalRows }条记录，总共${page.totalPages }页
		    		</span>
		    		&nbsp;&nbsp;&nbsp;&nbsp;
		    		<c:if test="${page.currentPage != 1}">
		    			<a href="provider/listProviderAdmin.action?pageNo=${pageNo -1}&hrefFlag=true&providerName=${providerName}">上一页</a>
		    		&nbsp;&nbsp;
		    		</c:if>
					<c:if test="${page.currentPage != page.totalPages}">
		    			<a href="provider/listProviderAdmin.action?pageNo=${pageNo +1}&hrefFlag=true&providerName=${providerName}">下一页</a>
		    		</c:if>
				</td>
		    </tr>
	    </tfoot>
	  </table>
	  </form>
	</div>
  </body>
</html>
